package com.airsystem.pos.bengkel.model;

import java.awt.GridBagLayout;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableModel;

import com.airsystem.pos.bengkel.component.DesktopFrame;

/**
 * @author Budi Oktaviyan <budi.oktaviyan@icloud.com>
 */
public class MasterCustomerModel extends DesktopFrame {
	protected int row = 0;

	protected GridBagLayout baseLayout = new GridBagLayout();
	protected GridBagLayout panelLayout = new GridBagLayout();

	protected JScrollPane tablecustomerScroll = new JScrollPane();

	protected JPanel basePanel = new JPanel();
	protected JPanel buttonPanel = new JPanel();

	protected JLabel namaLabel = new JLabel();
	protected JLabel kendaraanLabel = new JLabel();
	protected JLabel tahunLabel = new JLabel();
	protected JLabel nopolLabel = new JLabel();
	protected JLabel norangkaLabel = new JLabel();
	protected JLabel nomesinLabel = new JLabel();

	protected JTextField namaField = new JTextField();
	protected JTextField tahunField = new JTextField();
	protected JTextField nopolField = new JTextField();
	protected JTextField norangkaField = new JTextField();
	protected JTextField nomesinField = new JTextField();
	protected JTextField idField = new JTextField();
	protected JTextField fkField = new JTextField();

	protected JComboBox merkkendaraanCombo = new JComboBox();
	protected JComboBox submerkkendaraanCombo = new JComboBox();

	protected JTable tableCustomer = new JTable();

	protected JButton searchButton = new JButton();
	protected JButton addButton = new JButton();
	protected JButton saveButton = new JButton();
	protected JButton updateButton = new JButton();
	protected JButton deleteButton = new JButton();
	protected JButton cancelButton = new JButton();

	protected DefaultTableModel tableModel = new DefaultTableModel(new Object[][] {},
																   new String[] { "Merk Kendaraan", "Sub Merk Kendaraan", "Tahun",
																				  "No.Polisi", "No.Rangka", "No.Mesin",
																				  "STATUS", "FK" }) {

		boolean[] canEdit = new boolean[] { false, false, false,
											false, false, false,
											false, false };

		public boolean isCellEditable(int rowIndex, int columnIndex) {
			return canEdit[columnIndex];
		}
	};

	public MasterCustomerModel() {
		super();
	}
}